ci(linux): bring up redis-server and mysql-server for unittests#1
ci(linux): bring up redis-server and mysql-server for unittests#1rajvarun77 wants to merge 3 commits into
Conversation
The clang-unittest and clang-unittest-asan jobs run the full unit test suite via test/run_tests.sh, which includes backend integration tests (e.g. brpc_redis_unittest) that fork a real server when its binary is present and otherwise silently short-circuit to a passing result. Since CI never installed those servers, the redis backend tests reported PASSED while doing nothing (7 of 14 RedisTest cases skip-as-pass). Install redis-server and mysql-server before running the tests in both unittest jobs so these backend tests execute against a live server. The binaries are added only in the unittest jobs, not in the shared install-essential-dependencies action used by compile-only jobs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The failing
|
brpc_redis_unittest forks a real redis-server and waits a fixed 50ms before connecting; under ASan redis starts too slowly, causing flaky connection-refused. Skip RedisTest.* in the ASan job only (still covered by clang-unittest). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-dependencies Move the redis-server/mysql-server install out of the individual clang-unittest and clang-unittest-asan jobs and into the shared install-essential-dependencies composite action, so every job that installs dependencies has the servers available (and the unittest jobs no longer carry a bespoke install step). Under ASan the redis integration tests (sanity, keys_with_spaces, incr_and_decr, by_components, auth) fork a real redis-server and connect after a fixed 50ms wait; redis starts too slowly there and they flake with connection refused. Filter just those out under ASan -- the redis codec/server tests still run, and the full suite runs in clang-unittest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

What
Install
redis-serverandmysql-serverin theclang-unittestandclang-unittest-asanjobs (Linux), right beforerun_tests.sh, so the backendintegration tests in the unit-test suite execute against a live server instead
of silently no-op'ing.
Why
test/run_tests.shrunsbrpc_redis_unittest, which forks a realredis-serverwhen the binary is found and otherwise short-circuits eachredis-dependent case with a bare
return. gtest counts thatreturnasPASS, not SKIP. Because CI never installed
redis-server, 7 of the 14RedisTestcases (sanity,keys_with_spaces,incr_and_decr,by_components,auth,cmd_format,quote_and_escape) reported[ OK ]while doing nothing — a long-standing false green. The remaining 7 cases are
true in-process unit tests and are unaffected.
Installing the server binary lets these cases run for real.
mysql-serverisadded alongside redis to bring the same live-backend coverage to the in-flight
MySQL backend work (apache#2093 / apache#3310).
Scope
install-essential-dependenciesaction (which feeds compile-only jobs thatmust stay lean).
test/run_tests.shis unchanged — it already builds and runsbrpc_*unittest.convert the silent
returnskips to honestGTEST_SKIP()and add arequire-backend flag so a missing server hard-fails CI instead of skipping.
Test plan
install, then
run_tests.shexercises the redis backend tests against the liveserver.